Call:
rpart(formula = medv ~ ., data = train_data, method = "anova")
n= 354
CP nsplit rel error xerror xstd
1 0.42405694 0 1.0000000 1.0069693 0.10321272
2 0.21026065 1 0.5759431 0.7321337 0.08106374
3 0.07644921 2 0.3656824 0.4281859 0.06230105
4 0.05551767 3 0.2892332 0.3529659 0.05299589
5 0.03285557 4 0.2337155 0.3194054 0.05344333
6 0.02617964 5 0.2008600 0.3174609 0.05357744
7 0.01479480 6 0.1746803 0.2968507 0.04900006
8 0.01000000 7 0.1598855 0.2891316 0.04939241
Variable importance
lstat rm nox indus age crim ptratio dis tax rad
23 20 13 13 12 11 3 2 1 1
zn
1
Node number 1: 354 observations, complexity param=0.4240569
mean=22.30113, MSE=82.43819
left son=2 (197 obs) right son=3 (157 obs)
Primary splits:
lstat < 9.95 to the right, improve=0.4240569, (0 missing)
rm < 6.941 to the left, improve=0.4218644, (0 missing)
indus < 6.66 to the right, improve=0.2574640, (0 missing)
ptratio < 19.9 to the right, improve=0.2572803, (0 missing)
nox < 0.6695 to the right, improve=0.2217527, (0 missing)
Surrogate splits:
indus < 7.625 to the right, agree=0.819, adj=0.592, (0 split)
nox < 0.5175 to the right, agree=0.808, adj=0.567, (0 split)
age < 58.75 to the right, agree=0.780, adj=0.503, (0 split)
rm < 6.3825 to the left, agree=0.777, adj=0.497, (0 split)
crim < 0.127795 to the right, agree=0.766, adj=0.471, (0 split)
Node number 2: 197 observations, complexity param=0.07644921
mean=17.02284, MSE=24.64146
left son=4 (109 obs) right son=5 (88 obs)
Primary splits:
lstat < 15.11 to the right, improve=0.4595916, (0 missing)
dis < 2.0941 to the left, improve=0.3775044, (0 missing)
crim < 6.91188 to the right, improve=0.3716208, (0 missing)
nox < 0.6635 to the right, improve=0.3287026, (0 missing)
ptratio < 19.9 to the right, improve=0.2947128, (0 missing)
Surrogate splits:
age < 91.15 to the right, agree=0.792, adj=0.534, (0 split)
dis < 2.37495 to the left, agree=0.746, adj=0.432, (0 split)
crim < 0.224635 to the right, agree=0.706, adj=0.341, (0 split)
nox < 0.607 to the right, agree=0.706, adj=0.341, (0 split)
ptratio < 19.9 to the right, agree=0.701, adj=0.330, (0 split)
Node number 3: 157 observations, complexity param=0.2102607
mean=28.9242, MSE=76.13661
left son=6 (140 obs) right son=7 (17 obs)
Primary splits:
rm < 7.437 to the left, improve=0.5133299, (0 missing)
lstat < 4.65 to the right, improve=0.3696308, (0 missing)
nox < 0.574 to the left, improve=0.1994501, (0 missing)
ptratio < 14.75 to the right, improve=0.1909466, (0 missing)
dis < 2.2227 to the right, improve=0.1844176, (0 missing)
Surrogate splits:
lstat < 3.21 to the right, agree=0.917, adj=0.235, (0 split)
zn < 87.5 to the left, agree=0.898, adj=0.059, (0 split)
indus < 1.23 to the right, agree=0.898, adj=0.059, (0 split)
ptratio < 14.55 to the right, agree=0.898, adj=0.059, (0 split)
Node number 4: 109 observations, complexity param=0.02617964
mean=13.99908, MSE=17.52505
left son=8 (66 obs) right son=9 (43 obs)
Primary splits:
tax < 551.5 to the right, improve=0.3999537, (0 missing)
crim < 7.46495 to the right, improve=0.3939602, (0 missing)
dis < 2.0012 to the left, improve=0.3403280, (0 missing)
nox < 0.5825 to the right, improve=0.3308657, (0 missing)
ptratio < 19.65 to the right, improve=0.3269934, (0 missing)
Surrogate splits:
crim < 4.06659 to the right, agree=0.972, adj=0.930, (0 split)
rad < 16 to the right, agree=0.972, adj=0.930, (0 split)
indus < 15.995 to the right, agree=0.862, adj=0.651, (0 split)
nox < 0.5825 to the right, agree=0.862, adj=0.651, (0 split)
ptratio < 19.65 to the right, agree=0.826, adj=0.558, (0 split)
Node number 5: 88 observations
mean=20.76818, MSE=8.103533
Node number 6: 140 observations, complexity param=0.05551767
mean=26.74571, MSE=40.14891
left son=12 (104 obs) right son=13 (36 obs)
Primary splits:
rm < 6.7905 to the left, improve=0.2882446, (0 missing)
dis < 2.19775 to the right, improve=0.2506449, (0 missing)
age < 88.8 to the left, improve=0.2349574, (0 missing)
nox < 0.618 to the left, improve=0.2346386, (0 missing)
crim < 4.548895 to the left, improve=0.2118173, (0 missing)
Surrogate splits:
ptratio < 13.85 to the right, agree=0.779, adj=0.139, (0 split)
indus < 1.605 to the right, agree=0.771, adj=0.111, (0 split)
tax < 222.5 to the right, agree=0.771, adj=0.111, (0 split)
lstat < 3.575 to the right, agree=0.771, adj=0.111, (0 split)
nox < 0.4045 to the right, agree=0.750, adj=0.028, (0 split)
Node number 7: 17 observations
mean=46.86471, MSE=11.56111
Node number 8: 66 observations
mean=11.86212, MSE=11.1366
Node number 9: 43 observations
mean=17.27907, MSE=9.56305
Node number 12: 104 observations, complexity param=0.03285557
mean=24.74423, MSE=30.31997
left son=24 (96 obs) right son=25 (8 obs)
Primary splits:
age < 88.8 to the left, improve=0.3040735, (0 missing)
dis < 2.0409 to the right, improve=0.3023080, (0 missing)
crim < 2.17451 to the left, improve=0.2954498, (0 missing)
rad < 7.5 to the left, improve=0.2717743, (0 missing)
nox < 0.589 to the left, improve=0.2432020, (0 missing)
Surrogate splits:
dis < 2.28545 to the right, agree=0.981, adj=0.750, (0 split)
nox < 0.589 to the left, agree=0.971, adj=0.625, (0 split)
crim < 1.031935 to the left, agree=0.962, adj=0.500, (0 split)
indus < 16.57 to the left, agree=0.962, adj=0.500, (0 split)
ptratio < 14.75 to the right, agree=0.962, adj=0.500, (0 split)
Node number 13: 36 observations
mean=32.52778, MSE=23.53867
Node number 24: 96 observations, complexity param=0.0147948
mean=23.86771, MSE=11.44135
left son=48 (60 obs) right son=49 (36 obs)
Primary splits:
rm < 6.469 to the left, improve=0.39309030, (0 missing)
lstat < 5.41 to the right, improve=0.20958610, (0 missing)
ptratio < 20.95 to the right, improve=0.15346410, (0 missing)
nox < 0.5125 to the right, improve=0.08370723, (0 missing)
rad < 6.5 to the left, improve=0.07870439, (0 missing)
Surrogate splits:
lstat < 5.505 to the right, agree=0.708, adj=0.222, (0 split)
rad < 6.5 to the left, agree=0.667, adj=0.111, (0 split)
crim < 0.019625 to the right, agree=0.656, adj=0.083, (0 split)
zn < 29 to the left, agree=0.656, adj=0.083, (0 split)
indus < 3.095 to the right, agree=0.646, adj=0.056, (0 split)
Node number 25: 8 observations
mean=35.2625, MSE=137.0098
Node number 48: 60 observations
mean=22.225, MSE=6.300208
Node number 49: 36 observations
mean=26.60556, MSE=8.016636